package com.mapper;

import com.pojo.Answer_lfy;
import com.pojo.Problem_lfy;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Problem_lfyMapper {
    @Select("select answer_context,answer_pid from problem_lfy left join answer_lfy on problem_id=answer_pid ")
    @Results({
            @Result(column = "answer_context",property = "answerContext"),
            @Result(column = "answer_pid",property = "answerPid"),
            @Result(property = "problem_lfy",column = "answer_pid",one=@One(select = "com.mapper.Problem_lfyMapper" +
                    ".selectOne"))
    })
    List<Answer_lfy> selectAll();

    @Select("select problem_context from problem_lfy where problem_id=#{id}")
    Problem_lfy selectOne(Integer id);
}
